#ifndef CDEFENDER_H
#define CDEFENDER_H

#include <windows.h>
#include "psapi.h"
#include <tlhelp32.h>

#include <QObject>
#include <QTimer>
#include <QMap>
#include <QSettings>
#include <QSystemTrayIcon>
#include <QMenu>

class CDefender : public QObject
{
    Q_OBJECT
public:
    explicit CDefender(QObject *parent = 0);

    void init();
    void initSysTray();
public:
    void append(QString strAppName);
    void remove(QString strAppName);
    bool isRuning(QString strName);
    bool openUrl(QString strUrl);

private slots:
    void slotCheckTime();
private:
    QTimer *m_pTimer = nullptr;

    QSettings *m_pSettings = nullptr;
    QMap<QString,QString> m_mapDefender;
};

#endif // CDEFENDER_H
